<template>
  <div>
    <h2 class="r_title">
      校管理
    </h2>
    <div class="p20">
      <div class="row">
        <div class="h3 row-item">筛选</div>
        <province v-if="roles.indexOf('admin') !== -1" class="pl10 row-item"/>
        <city v-if="roles.indexOf('admin') !== -1" class="pl10 row-item"/>
        <area-s v-if="roles.indexOf('admin') !== -1" class="pl10 row-item"/>
        <join-year v-if="roles.indexOf('admin') !== -1 || roles.indexOf('area') !== -1" class="pl10 row-item"/>
        <div class="h3 pl10 row-item">学校</div>
        <search v-if="roles.indexOf('admin') !== -1" style="width: 207px" class="pl10 row-item" :placeholder="'请输入学校'" :storeFunction="'SetSchoolName'"/>
        <school v-if="roles.indexOf('area') !== -1" class="pl10 row-item"/>
      </div>
      <div class="bod mt20">
        <school-table></school-table>
      </div>
    </div>
  </div>
</template>

<script>
import province from '../../components/select/province'
import city from '../../components/select/city'
import search from '../../components/input/search'
import areaS from '../../components/select/area'
import joinYear from '../../components/select/joinYear'
import school from '../../components/select/school'
import { mapGetters } from 'vuex'
import schoolTable from './table/school'
export default {
  name: 'school-management',
  components: {
    province,
    city,
    joinYear,
    areaS,
    search,
    school,
    schoolTable
  },
  computed: {
    ...mapGetters([
      'roles'
    ])
  },
  mounted () {
    this.$store.dispatch('setRoute', this.$route.path)
  }
}
</script>

<style scoped>

</style>
